<template>
  <div id="unorderModule">
    <Table width="100%" border :columns="columns1" :data="ajaxdata" :no-data-text="$t('order.nodata')"
           :no-filtered-data-text="$t('order.nodata')" :loading="loading"></Table>
  </div>
</template>
<script>

  export default {
    name:"unorderModule",
    data() {
      return {
        loading: true,
        columns1: [
          {
            key: "statedesc",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.statedesc'))
            }
          },
          {
            key: "PONumber",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.PONumber'))
            }
          },
          {
            key: "POVersionNumber",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.POVersionNumber'))
            }
          },
          {
            key: "senderName",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.senderName'))
            }
          },
          {
            key: "senderPerson",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.senderPerson'))
            }
          },
          {
            key: "recipient",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.recipient'))
            }
          },
          {
            key: "latestUpdateDateTime",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.latestUpdateDateTime'))
            }
          },
          {
            key: "T1Customer",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.T1Customer'))
            }
          },
          {
            key: "currency",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.currency'))
            }
          },
          {
            key: "buyerContactPerson",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.buyerContactPerson'))
            }
          },
          {
            key: "actualManufacturerCode",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.actualManufacturerCode'))
            }
          },
          {
            key: "buyerContactEmail",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.buyerContactEmail'))
            }
          },
          {
            key: "actualManufacturerUser",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.actualManufacturerUser'))
            }
          },
          {
            key: "POReviseDate",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.POReviseDate'))
            }
          },
          {
            fixed: 'right',
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.action'))
            },
            render: (h, params) => {
              return h('div', [
                h('Button', {
                  props: {
                    type: 'text',
                    size: 'small'
                  }
                }, 'View')
              ]);
            }
          },
          {
            key: "season",
            renderHeader:(h,params)=>{
              return h('span',this.$t('order.season'))
            }
          },
        ],
        ajaxdata: []
      }
    },
    computed:{
    },
    methods: {
      handleinit() {
        let $userdata = localStorage.getItem('userinfo')
        $userdata = eval("(" + $userdata + ")")
        console.log($userdata)
        let $Username = $userdata.Username
        let $Type = $userdata.Type
        let $data = {
          page: 1,
          limit: 20,
          username: $Username,
          type: $Type
        }
        let $params = {
          params: $data
        }
        this.$axios.get('P_T1DenyList.asp', $params).then((res) => {
          this.loading = false
          let $resp_data = res.data.data
          //过滤数组空字符串
          $resp_data.forEach((val, index) => {
            if (val == "") {
              $resp_data.pop(index)
            }
          })
          this.ajaxdata = $resp_data
        })
      },
    },
    mounted() {
      this.handleinit();
    }
  };
</script>


<style lang="less" scoped>

</style>
